#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"

signed main()
{
	long long oop,aa,bb;
	cin>>oop;
 	while(oop--){
	 cin >>aa >> bb;
	 int xx =aa/bb;
	 int yy =aa%bb;
	
	 cout << aa << "=" << xx << '*' << bb <<'+'<< yy << endl;
	}
	return 0;
}

